unit uPesquisaCidade;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uPesquisaPadrao, DB, IBODataset, ComCtrls, Grids, DBGrids,
  RXDBCtrl, StdCtrls, RXCtrls, ExtCtrls;

type
  TfPesquisaCidade = class(TfPesquisaPadrao)
    queryCODIGO: TSmallintField;
    queryNOME: TStringField;
    queryUF: TStringField;
    queryIBGE: TStringField;
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fPesquisaCidade: TfPesquisaCidade;

implementation

{$R *.dfm}

procedure TfPesquisaCidade.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  inherited;
  if key = #13 then
  begin
    query.close;
    query.SQL.Clear;
    query.SQL.Add('select * from cidade');
    query.SQL.Add('where cidade.nome like '''+Edit1.Text+'%''');
    query.SQL.Add('order by cidade.nome');
    query.Open;
  end;
end;

end.
